/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    overflow-x: hidden;
}

body.dark-theme {
    background-color: #2e2626;
    color: #fff;
}

.app-container {
    max-width: 414px;
    margin: 0 auto;
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
    transition: opacity 0.25s ease-in-out;
    opacity: 1;
}

.app-container.fade-out {
    opacity: 0;
}

.app-container.fade-in {
    opacity: 1;
}

/* 状态栏样式 */
.status-bar {
    display: flex;
    justify-content: space-between;
    padding: 5px 15px;
    font-size: 14px;
}

.status-icons {
    display: flex;
    align-items: center;
}

.status-icons i, .status-icons span {
    margin-left: 5px;
}

.battery {
    display: flex;
    align-items: center;
}

/* 导航栏样式 */
.nav-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    padding: 0 10px;
    position: relative;
    overflow-x: auto;
    white-space: nowrap;
}

.dark-theme .nav-tabs {
    border-bottom: 1px solid #3a3636;
}

.tab {
    padding: 12px 18px;
    font-size: 16px;
    position: relative;
    cursor: pointer;
}

.tab.active {
    font-weight: bold;
    color: #07c160;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 18px;
    width: calc(100% - 36px);
    height: 3px;
    background-color: #07c160;
}

/* 搜索框样式 */
.search-container {
    display: flex;
    padding: 15px;
    align-items: center;
}

.search-box {
    flex: 1;
    background-color: #eee;
    border-radius: 20px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
}

.dark-theme .search-box {
    background-color: #3a3636;
}

.search-box i {
    color: #999;
    margin-right: 10px;
}

.search-text {
    color: #999;
}

.voice-search {
    margin-left: 10px;
    width: 30px;
    height: 30px;
}

.voice-search img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 欢迎语样式 */
.greeting {
    padding: 0 15px 15px;
}

.greeting h2 {
    font-size: 20px;
    font-weight: normal;
}

/* 卡片区域样式 */
.card-scroll {
    display: flex;
    overflow-x: auto;
    padding: 0 15px;
    margin-bottom: 20px;
    scrollbar-width: none; /* Firefox */
}

.card-scroll::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.card {
    min-width: 220px;
    height: 230px;
    background-color: #fff;
    border-radius: 10px;
    margin-right: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.card:active {
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.dark-theme .card {
    background-color: #3a3636;
}

.card-content {
    padding: 15px;
    height: 130px;
}

.card-content h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.card-content p {
    font-size: 14px;
    color: #999;
}

.card-image {
    position: relative;
    height: 100px;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.play-button {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background-color: #07c160;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
}

.play-button-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
}

.playing-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #07c160;
}

/* 大家都在听部分样式 */
.popular-section {
    padding: 0 15px 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: bold;
}

.play-all-button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #666;
}

.dark-theme .play-all-button {
    background-color: #3a3636;
    color: #fff;
}

/* 歌曲列表样式 */
.song-list {
    display: flex;
    flex-direction: column;
}

.song-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    -webkit-tap-highlight-color: transparent;
}

.song-item:active {
    background-color: rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease;
}

.dark-theme .song-item {
    border-bottom: 1px solid #3a3636;
}

.dark-theme .song-item:active {
    background-color: rgba(255, 255, 255, 0.05);
}

.song-cover {
    width: 60px;
    height: 60px;
    border-radius: 5px;
    overflow: hidden;
    margin-right: 15px;
}

.song-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.song-info {
    flex: 1;
}

.song-title {
    font-size: 16px;
    margin-bottom: 5px;
}

.song-subtitle, .song-artist {
    font-size: 12px;
    color: #999;
}

.song-likes {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #999;
    font-size: 12px;
}

.song-likes i {
    margin-bottom: 5px;
    font-size: 16px;
}

/* 底部控制区域容器 */
.bottom-controls-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 414px;
    margin: 0 auto;
    z-index: 100;
    transition: transform 0.3s ease-in-out;
    will-change: transform;
}

.bottom-controls-container.slide-down {
    transform: translateY(100%);
}

/* 底部播放条样式 */
.bottom-player {
    background-color: #f5f5f5;
    padding: 8px;
    border-top: 1px solid #eee;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.dark-theme .bottom-player {
    background-color: #2e2626;
    border-top: 1px solid #3a3636;
}

.mini-player {
    display: flex;
    align-items: center;
}

.mini-cover {
    width: 40px;
    height: 40px;
    border-radius: 5px;
    overflow: hidden;
    margin-right: 10px;
}

.mini-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mini-info {
    flex: 1;
    overflow: hidden;
}

.mini-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}

.mini-controls {
    display: flex;
    gap: 15px;
}

.mini-controls i {
    font-size: 20px;
}

/* 底部导航样式 */
.bottom-nav {
    background-color: #fff;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    border-top: 1px solid #eee;
    transition: all 0.3s ease;
    overflow: hidden;
    height: 56px; /* 固定高度，便于动画过渡 */
    position: relative;
    z-index: 1;
}

.dark-theme .bottom-nav {
    background-color: #2e2626;
    border-top: 1px solid #3a3636;
}

/* 在详情页隐藏底部导航，但保留DOM结构 */
.playlist-page .bottom-nav {
    visibility: hidden;
    height: 0;
    padding: 0;
    opacity: 0;
    overflow: hidden;
}

/* 在详情页调整底部播放器位置 */
.playlist-page .bottom-player {
    border-radius: 0 0 10px 10px;
    padding-bottom: 16px; /* 占据导航栏的空间 */
}

/* 页面切换过程中的动画类 - 从index到playlist */
.bottom-nav.transitioning {
    height: 0;
    padding: 0;
    opacity: 0;
    margin-top: -1px;
}

.bottom-player.transitioning {
    padding-bottom: 16px; /* 增加底部填充以占据导航栏的位置 */
    border-radius: 0 0 10px 10px;
    margin-bottom: 0;
}

/* 从playlist返回index的过渡动画类 */
.bottom-nav.returning {
    height: 56px;
    padding: 8px 0;
    opacity: 1;
    visibility: visible;
    margin-top: 0;
}

.bottom-player.returning {
    padding-bottom: 8px; /* 恢复原始padding */
    border-radius: 0;
    margin-bottom: 0;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
    color: #999;
    -webkit-tap-highlight-color: transparent;
}

.nav-item:active {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.nav-item.active {
    color: #07c160;
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 3px;
}

/* 歌单详情页特有样式 */
.playlist-page .header {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
}

.back-button, .more-options {
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}

.back-button:active, .more-options:active {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.playlist-info {
    padding: 20px 15px;
}

.playlist-title-container {
    display: flex;
    flex-direction: column;
    position: relative;
}

.playlist-ai-tag {
    font-size: 14px;
    margin-bottom: 10px;
    color: #999;
}

.playlist-title {
    font-size: 24px;
    margin-bottom: 15px;
}

.playlist-cover {
    position: absolute;
    right: 0;
    top: 0;
    width: 180px;
    height: 180px;
    border-radius: 10px;
    overflow: hidden;
}

.playlist-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.playlist-description {
    margin-top: 20px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.playlist-description p {
    font-size: 14px;
    color: #999;
    line-height: 1.5;
}

.action-bar {
    display: flex;
    padding: 15px 0;
}

.action-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 30px;
    color: #999;
    -webkit-tap-highlight-color: transparent;
}

.action-button:active {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.action-button i {
    font-size: 20px;
    margin-bottom: 5px;
}

.vip-info {
    display: flex;
    align-items: center;
    background-color: #f8f8f8;
    padding: 10px;
    border-radius: 5px;
    margin: 15px 0;
}

.vip-icon {
    background-color: #ffcc00;
    color: #333;
    width: 25px;
    height: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    margin-right: 10px;
}

.vip-button {
    margin-left: auto;
    color: #ffcc00;
    font-size: 14px;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}

.vip-button:active {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.vip-button i {
    margin-left: 5px;
}

.play-controls {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background-color: #f0f0f0;
    border-radius: 5px 5px 0 0;
}

.play-all-button {
    display: flex;
    align-items: center;
    background-color: transparent;
    color: #333;
    width: auto;
    height: auto;
    -webkit-tap-highlight-color: transparent;
}

.play-all-button:active {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.play-all-button i {
    margin-right: 10px;
}

.song-count {
    color: #999;
    font-size: 14px;
    margin-left: 5px;
}

.control-icons {
    display: flex;
    gap: 15px;
}

.control-icons i {
    -webkit-tap-highlight-color: transparent;
}

.control-icons i:active {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.song-list-container {
    background-color: #f5f5f5;
    padding: 0 15px;
    margin-bottom: 100px; /* 为底部播放器留出空间 */
}

.song-list-container .song-item {
    padding: 15px 0;
}

.song-index {
    font-size: 16px;
    color: #999;
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

.song-actions {
    display: flex;
    gap: 15px;
    color: #999;
}

.song-actions i {
    -webkit-tap-highlight-color: transparent;
}

.song-actions i:active {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.vip-badge, .quality-badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 3px;
    margin-left: 5px;
}

.vip-badge {
    background-color: #ffcc00;
    color: #333;
}

.quality-badge {
    border: 1px solid #999;
}

/* SVG 图像样式优化 */
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* 页面切换动画 */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(100%);
    }
}

.slide-up {
    animation: slideUp 0.3s ease-in-out forwards;
}

.slide-down {
    animation: slideDown 0.3s ease-in-out forwards;
}
